package com.example.service;

import java.util.Date;
import java.util.List;
import java.util.Optional;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.stereotype.Service;

import com.example.mdao.QuexianzhidingMapper;
import com.example.model.jdao.QuexianzhidingDao;
import com.example.pojo.Quexianzhiding;

@Service
public class QuexianService {
	 @Autowired
	 QuexianzhidingDao dao;
	 @Autowired
	 QuexianzhidingMapper mapper;
	    //分页查询
		public Page<Quexianzhiding> findAll(Pageable pageable){
			return dao.findAll(pageable);
			
		}
		//根据id查询
		public Optional<Quexianzhiding> findByid(Integer id){
			
			return dao.findById(id);
			
		}
		//新增
		public Quexianzhiding insert(Quexianzhiding q) {
			return dao.save(q);
		}
		
		//mybatis
		//修改
		public Quexianzhiding update(Quexianzhiding q) {
			return dao.save(q);
		}
		public void updateisqx(Integer rwid,String isqx) {
			mapper.updateisqx(rwid, isqx);
		}
		//模糊查询
		public List<Quexianzhiding> mohufind(
				Integer rwid,String rwname,String rwdj,String xfuser,String xfdate) {
			return mapper.mohufind(rwid, rwname, rwdj, xfuser, xfdate);
		}
		//查询所有
		public List<Quexianzhiding> findallque(){
			return  mapper.findallque();
			
		}
		
		//模糊查询下发人倒序出来
		public List<Quexianzhiding> mhcxque(String rwname,String xfuser){
			return mapper.mhcxque(rwname,xfuser);
			
		}
		
		
}
